package com.hhit.yb.compose_demo.views.basic

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Favorite
import androidx.compose.material.icons.filled.Menu
import androidx.compose.material3.Divider
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.ListItem
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.unit.dp
import com.hhit.yb.compose_demo.views.TutorialHeader
import com.hhit.yb.compose_demo.views.TutorialText2

@Composable
fun Tutorial2_5Screen7() {
    LazyColumn(
        contentPadding = PaddingValues(8.dp),
        verticalArrangement = Arrangement.spacedBy(8.dp)
    ) {
        item {
            TutorialHeader(text = "ListItem")
            TutorialText2(text = "basic demo")
            OneLineListItemExample()
        }
    }
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun OneLineListItemExample() {
    Column {
        ListItem(headlineText = { Text("One line list item with no icon") }, overlineText = {
            Text(
                text = "this is overline text"
            )
        }, supportingText = { Text(text = "this is supporting text") }, leadingContent = {
            Text(
                text = "leading content"
            )
        }, trailingContent = { Text(text = "trailing content") })
        Divider()
        ListItem(
            overlineText = { Text(text = "show head info here.") },
            headlineText = { Text(text = "this is headline text.") },
            supportingText = {
                Text(
                    text = "show bottom info here."
                )
            },
            leadingContent = { Icon(imageVector = Icons.Default.Menu, contentDescription = "") },
            trailingContent = {
                Icon(
                    imageVector = Icons.Default.Favorite,
                    contentDescription = ""
                )
            })
    }
}






















